package com.atguigu.demo.excel;

import com.alibaba.excel.context.AnalysisContext;
import com.alibaba.excel.event.AnalysisEventListener;

import java.util.Map;

/**
 * @Author hg
 * @CreatedTime 2020-10-05-11:21
 */
public class ExcelListener extends AnalysisEventListener<DemoDataExcel> {

    // 每次只会读取一行
    @Override
    public void invoke(DemoDataExcel demoDataExcel, AnalysisContext analysisContext) {
        System.out.println("invoke *** " + demoDataExcel);
    }

    // 读取比奥拓内容
    @Override
    public void invokeHeadMap(Map<Integer, String> headMap, AnalysisContext context) {
        System.out.println("读取表头 " + headMap);
    }

    // 读取完成之后
    @Override
    public void doAfterAllAnalysed(AnalysisContext analysisContext) {
        System.out.println("读取完成");
    }
}
